#ifndef CONSTRAINTSYSTEM_H
#define CONSTRAINTSYSTEM_H

#include "ParticleSystem.h"

class Constraint
{
public:
	Constraint(Particle *a, Particle *b, double distance);
	~Constraint(){};

public:
	Particle *jun;
	Particle *sen;
	double distance;
	int index;
};

typedef vector<Constraint*> ConstraintList;

class ConstraintSystem
{
public:
	ConstraintSystem(void);
	ConstraintSystem(double alpha, double beta);
	~ConstraintSystem(void);
	void Clear();
	void AddConstraint(Constraint *c);
	void GetConstraint(double *constraint);
	void GetConstraintDeriv(double *consDe);
	void GetConstraintJacobian(double **jacobian, ParticleList *particles);
	void GetConstraintJacobianDerivVector(double *jacobianV, ParticleList *particles);
	void GetHarmonicOsciliator(double *harmonic, ParticleList *particles);
	int GetScale();

public:
	ConstraintList constraints;
	double alpha;
	double beta;
};

#endif


